<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>首页</title>
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container mt-5">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">
                    <h3 class="text-center">欢迎来到用户管理系统</h3>
                </div>
                <div class="card-body text-center">
                    {% if request.session.username %}
                        <h4>欢迎，{{ request.session.username }}！</h4>
                        <p class="text-muted">您已成功登录系统</p>
                        <div class="mt-4">
                            <a href="/user/logout/" class="btn btn-outline-danger">退出登录</a>
                        </div>
                    {% else %}
                        <h4>请选择操作</h4>
                        <p class="text-muted">请先登录或注册账号</p>
                        <div class="mt-4">
                            <a href="/user/login/" class="btn btn-primary me-3">登录</a>
                            <a href="/user/register/" class="btn btn-success">注册</a>
                        </div>
                    {% endif %}
                </div>
            </div>
        </div>
    </div>
</div>

<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>